<link href="./css/style.css" rel="stylesheet" type="text/css" />
<div class="main">
<div class="useredit">
	<p class="tt"><a>首页</a>><a href="userlist.php">会员管理</a>><span>修改信息</span></p>
	<form class="uedit">
		<input type="hidden" name="id" value="{$v[Id]}" />
		<input type="hidden" name="t0" value="{$v[uname]}" />
		<p class="p1"><span>会员账号</span><em>{$v[uname]}</em></p>
		<p class="p2"><span>登录密码</span><input type="password" name="t1" placeholder="请输入会员密码" /></p>
		<p class="p2"><span>手机号</span><input type="text" name="phone" placeholder="请输入会员手机号" value="{$v[phone]}" /></p>
		<p class="p2"><span>会员姓名</span><input type="text" name="t2" placeholder="请输入会员姓名" value="{$v[tname]}" /></p>		
		<p class="p2"><span>会员级别</span><select name='level'>
			<option {if($v['level']==0)} selected {/if} value='0'>{$tdarr[0]}</option>
			<option {if($v['level']==1)} selected {/if} value='1'>{$tdarr[1]}</option>
			<option {if($v['level']==2)} selected {/if} value='2'>{$tdarr[2]}</option>
		</select></p>
		<p class="p2"><span>团队级别</span><select name='tlevel'>
			<option {if($v['tlevel']==0)} selected {/if} value='0'>无</option>
			<option {if($v['tlevel']==1)} selected {/if} value='1'>{$tdarr1[1]}</option>
			<option {if($v['tlevel']==2)} selected {/if} value='2'>{$tdarr1[2]}</option>
			<option {if($v['tlevel']==3)} selected {/if} value='3'>{$tdarr1[3]}</option>
			<option {if($v['tlevel']==4)} selected {/if} value='4'>{$tdarr1[4]}</option>
			<option {if($v['tlevel']==5)} selected {/if} value='5'>{$tdarr1[5]}</option>
			<option {if($v['tlevel']==6)} selected {/if} value='6'>{$tdarr1[6]}</option>
			<option {if($v['tlevel']==7)} selected {/if} value='7'>{$tdarr1[7]}</option>
		</select></p>
		
		
		<button type="button" onclick="useredit();">确认修改</button>
	</form>
	<script src="./js/jquery.js"></script>
	<script>
	$(".dl").change("on",function(){
		var index = $(".dl option:selected").val();
		if(index==0){
			$(".province,.city,.county").hide();
		}else if(index==1){
			$(".city,.county").hide();
			$(".province").show();
		}else if(index==2){
			$(".county").hide();
			$(".province,.city").show();
		}else{
			$(".province,.city,.county").show();
		}
	});
	$("#province").change(function (){
	var index = $("#province option:selected").val();
	if(index>0){
		$.ajax({
			type:"post",
			dataType:"json",
			url:"/Moudel.php?m=m&a=province",
			data:"id="+index,
			success:function(d){
				if(d[0]==1){
					$("#city").html(d[1]);
				}
			}
		});
		}
	});
	$("#city").change(function (){
		index = $("#city option:selected").val();
		if(index>0){
		$.ajax({
			type:"post",
			dataType:"json",
			url:"/Moudel.php?m=m&a=city",
			data:"id="+index,
			success:function(d){
				if(d[0]==1){
					$("#county").html(d[1]);
				}
			}
		});
		}
	});	
	function useredit(){
			$.ajax({
				type:"post",
				dataType:"json",
				url:"/Moudel.php?m=m&a=uedit",
				data:$(".uedit").serialize(),
				success:function(d){
					if(d[0]==0){
						alert(d[1]);
					}
					else{
						alert(d[1]);						
						window.location.href='userlist.php?page={$page}&uname={$uname}&level={$level}&tlevel={$tlevel}';										
					}
				}
			});
		}
	</script>
	
</div>
</div>
<script>
	h1 = $(".main").height();
	h2 = $(".useredit").height();
	if(h2>h1){
		$(".main").css("height","auto");
	}
</script>
